*Note: This code estimates the summary statistics reported in Table A.3 of the Supplemntal Appendix.
*	To do so, it reads-in the Stata .dta file "MainMalariaDataset.dta" and then saves the relevant output needed for
*	building Table A.3. For the final step, this file also reads-in "cowcodeswithnames.dta"

*clear Stata
clear
clear matrix

*set working directory
cd  ""

*start log file
log using "Tables_A3", replace

*read-in directed dyadic malaria data
use "MainMalariaDataset.dta"

*format variables and collapse by country 2
generate malariasd=Lmalaria_interp_2_m 
collapse (mean) Lmalaria_interp_2_m (sd) malariasd, by(cowcode_2)

*organize data for table
sort cowcode_2 
merge cowcode_2 using cowcodeswithnames
drop if _merge==2
drop _merge stateabb cowcode_2
sort statenme 
drop if Lmalaria_interp_2_m==.

*save results as a CSV for use in building Table. A.3
export delimited using "countrystatsfortable.csv", replace

*close log file
log close
